﻿using System;
using System.Text;
using System.Net;
using System.Net.Mail;


/// <summary>
/// ClassName:MailHelper
/// Author:zane
/// Time:2012.9.13
/// Remark:通用方法-发送电子邮件类
/// </summary>
public class MailHelper
{
    public static void SetMail(string mailAddress, string title, string bodys)
    {
        return;
        //MailMessage mails = new MailMessage();
        //mails.From = new MailAddress("chenglongkii@163.com"); //邮件的来源
        //mails.To.Add(new MailAddress(mailAddress)); //邮件的目标地址
        //mails.Subject = title; //邮件标题
        //mails.Body = bodys; //邮件正文
        //mails.Priority = MailPriority.High;//定义邮件的优先级
        //mails.IsBodyHtml = true; //使用HTML格式的邮件
        ////mails.BodyEncoding = Encoding.GetEncoding("GB2312");//设置邮件主题编码格式
        //SmtpClient sc = new SmtpClient("smtp.163.com");
        //sc.Credentials = new NetworkCredential("chenglongkii@163.com", "PPMTJSKBMYUBNYIX");

        ////SmtpClient sc = new SmtpClient("smtp.qq.com");
        ////sc.EnableSsl = true;
        ////sc.Credentials = new NetworkCredential("798506003@qq.com", "123456789ren");
        //try
        //{
        //    sc.Send(mails);
        //}
        //catch (Exception ex)
        //{
        //    throw;
        //}
    }
}